package com.jwsoft.manager.core.dao.model;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * 地址和学段关联记录表
 *
 * @author fangs
 * @since 2023-02-24
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("edu_address_category")
@Schema(name = "EduAddressCategory", title = "地址和学段关联记录表", description = "地址和学段关联记录表实体类")
public class EduAddressCategory extends Model<EduAddressCategory> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @Schema(name = "addressId", title = "edu_address主键")
    @TableField(value = "address_id")
    private String addressId;

    @Schema(name = "treeId", title = "edu_address_tree主键")
    @TableField(value = "tree_id")
    private Long treeId;

    @Schema(name = "addressName", title = "地址")
    @TableField(value = "address_name")
    private String addressName;

    @Schema(name = "schoolCategory", title = "学校类别")
    @TableField(value = "school_category")
    private String schoolCategory;

    @Schema(name = "matchingStatus", title = "是否匹配学区 0 未匹配 1已匹配成功")
    @TableField(value = "matching_status")
    private String matchingStatus;

    @Schema(name = "matchingTime", title = "自动匹配学区时间")
    @TableField(value = "matching_time")
    private Date matchingTime;

    @Schema(name = "matchingMessage", title = "匹配学区处理结果信息")
    @TableField(value = "matching_message")
    private String matchingMessage;

    @Schema(name = "schoolNum", title = "匹配到的学校数")
    @TableField(value = "school_num")
    private Integer schoolNum;

    @TableField(value = "del", fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NOT_NULL)
    @TableLogic
    private String del;

    @TableField(value = "del_uk", updateStrategy = FieldStrategy.NOT_NULL)
    private Long delUk;

    @Override
    public Serializable pkVal() {
        return this.id;
    }
}
